package com.five.dao.impl.reception;

import com.five.dao.reception.ReserveDao;
import com.five.util.DBUtil;
import org.springframework.stereotype.Repository;

import java.sql.Date;
import java.util.List;
import java.util.Map;

/**
 * @Author: 王登峰
 * @Description:
 * @Date: 2020/12/6 12:25
 */
@Repository
public class ReserveDaoImpl implements ReserveDao {
    @Override
    public List<Map> selectOrderBytel(Integer tel){
        String sql = "select a.*,b.name typename from t_order a left join t_type b on a.roomtype=b.id where uid = ? group by createtime";
        return DBUtil.queryMap(sql,tel);
    }
    @Override
    public List<Map> selectRUzhuid(String orderid){
        String sql = "select * from t_ruzhudetail where orderid = ?";
        return DBUtil.queryMap(sql,orderid);
    }
    @Override
    public List<Map> selectOrderBytime(Integer id, String time){
        String sql = "select a.*,b.name typename,b.money from t_order a left join t_type b on a.roomtype=b.id where uid = ? and createtime = ?";
        return DBUtil.queryMap(sql,id,time);
    }
}
